﻿@using CV.Resources.View.Login

@model CV.Entities.Models.SignupModel

@{
    ViewBag.Title = SignUp.Title;
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        @if (Model.ErrorMessages != null && Model.ErrorMessages.Count != 0)
        {
            <div class="form-group">
                <div class="panel panel-danger">
                    <div class="panel-heading">Message</div>
                    <div class="panel-body">
                        <ul>
                            @foreach (var item in Model.ErrorMessages)
                            {
                                <li>
                                    @item
                                </li>
                            }
                        </ul>
                    </div>
                </div>
            </div>
        }

        <div class="col-md-12">
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            <div class="form-group ">
                @Html.LabelFor(model => model.Login, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.EditorFor(model => model.Login, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Login, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.PasswordFor(model => model.Password, htmlAttributes: new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
                </div>
                @Html.LabelFor(model => model.PasswordConfirm, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.PasswordFor(model => model.PasswordConfirm, htmlAttributes: new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.PasswordConfirm, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.TextBoxFor(model => model.FirstName, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" })
                </div>
                @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.TextBoxFor(model => model.LastName, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.DateOfBirth, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-4">
                    @Html.DatePickerFor(model => model.DateOfBirth, new { @class = "form-control datepicker" })
                    @Html.ValidationMessageFor(model => model.DateOfBirth, "", new { @class = "text-danger datepicker" })
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-offset-2 col-md-8">
                    <input type="submit" value="@SignUp.OK" class="btn btn-primary" />
                    @Html.ActionLink(SignUp.Cancel, "Index", null, new { @class = "btn btn-default" })
                </div>
            </div>
        </div>
    </div>
}

@section scripts {
    @Scripts.Render("~/bundles/jqueryval")

    <script type="text/javascript">
        $(".datepicker").datepicker({
            format: "dd/mm/yyyy"
        });
    </script>
}
